<template>
	<view>
		<u-navbar title="" :border-bottom="false" :is-back="false"/>
		<!-- <view class="header flex justify-center align-center">
			<image src="/static/logo.png" class="header-img" />
		</view>
		<view class="w-690 radius-30 bg-main1 flex justify-between align-center padding-lr" @click="handleUserLogin">
			<view class="flex align-center">
				<image src="/static/icon1.png" class="ai-img" />
				<view class="ai-text">
					<view class="text-lg">我是用户</view>
					<view class="text-999 padding-top">用户选择</view>
				</view>
			</view>
			<u-icon name="arrow-right" />
		</view>
		<view class="w-690 radius-30 bg-main1 flex justify-between align-center padding-lr" @click="handleLawyer">
			<view class="flex align-center">
				<image src="/static/icon2.png" class="ai-img" />
				<view class="ai-text">
					<view class="text-lg">我是律师/客服</view>
					<view class="text-999 padding-top">律师用户选择</view>
				</view>
			</view>
			<u-icon name="arrow-right" />
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		onLoad() {
			let token = uni.getStorageSync('token');
			let tabBarIndex = uni.getStorageSync('tabBarIndex');
			// if (token) {
			// 	let tabBarIndex = uni.getStorageSync('tabBarIndex');
			// 	if (tabBarIndex == 0) {
			// 		uni.reLaunch({
			// 			url: '/pages/index/index'
			// 		})
			// 	} else {
			// 		uni.reLaunch({
			// 			url: '/pages/conversations/conversations'
			// 		})
			// 	}
			// }
			if (token) {
				if (tabBarIndex == 0) {
					uni.reLaunch({
						url: '/pages/index/index'
					})
				} else {
					uni.reLaunch({
						url: '/pages/conversations/conversations'
					})
				}
			} else {
				uni.reLaunch({
					url: '/pages/user-login/user-login'
				})
			}
		},
		methods: {
			handleUserLogin() {
				uni.navigateTo({
					url: '/pages/user-login/user-login'
				})
			},
			handleLawyer() {
				uni.navigateTo({
					url: '/pages/lawyer-login/lawyer-login'
				})
			}
		},
	}
</script>
<style>
	page {
		background: #fff;
	}
</style>
<style lang="scss" scoped>
	.header {
		width: 100%;
		height: 176rpx;
		margin: 170rpx 0 96rpx 0;

		&-img {
			width: 176rpx;
			height: 176rpx;
		}
	}

	.ai-img {
		width: 108rpx;
		height: 154rpx;
	}

	.ai-text {
		padding-left: 72rpx;
	}

	.w-690 {
		margin: 0 auto 40rpx auto;
	}
</style>